Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

104
Views
"next build" (create-next-app) not working when deploying to Vercel

I am running through an error while trying to deploy the app to Vercel. The issue mainly happens when trying to run next build because it is working fine on my localhost:3000. This is package.json

{
  "name": "foodrecipe",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "next lint"
  },
  "dependencies": {
    "@contentful/rich-text-react-renderer": "^15.4.0",
    "contentful": "^9.0.3",
    "next": "11.1.2",
    "react": "17.0.2",
    "react-dom": "17.0.2"
  },
  "devDependencies": {
    "eslint": "7.32.0",
    "eslint-config-next": "11.1.2"
  }
}

This is the complete log:

enter image description here

enter image description here

These are getStaticPaths/props functions in [slug].js:


  const client = createClient({
    space: process.env.CONTENTFUL_SPACE_ID ,  
    accessToken:process.env.CONTENTFUL_ACCESS_KEY 
  })

  export const getStaticPaths = async()=>{
    const response = await client.getEntries({content_type:'recipesReactjs'})

    const paths = response.items.map(item =>{
      return{
        params:{slug: item.fields.slug}
      }
    })
    return{
      paths:paths,
      fallback:true, 
    }
  }

  export const getStaticProps = async(context)=>{ 
    const response = await client.getEntries({
      content_type:'recipesReactjs',
      'fields.slug':context.params.slug,
    })

    if(!response.items.length){
      return{
        redirect:{
          destination:'/', 
          permanant:false  
        }
      }
    }

    return{
      props:{myRecipe: response.items[0]},
      revalidate:1 , 
    }
  }

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!